import format from '@dfeidao/atom-mobile/dt/format';
import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import get from '@dfeidao/atom-mobile/local/get';
import set from '@dfeidao/atom-mobile/local/set';
import render from '@dfeidao/atom-mobile/render/render';
import parse from '@dfeidao/atom-nodejs/dt/parse';
import { Alert } from 'react-native';
import a005 from './a005';
import a010 from './a010';

export default async function a011(fd: IFeidaoAiMobile, e: Date) {
	// 确认
	const end_time = parse(e + "");
	const start_time = get(fd, "start_time");
	// console.log(currenttime);
	// console.log(end_time);
	let time2 = format(end_time, 1);
	if (end_time < start_time) {
		Alert.alert("结束时间不能小于开始时间");
		time2 = "";
	} else {
		set(fd, "end_time", end_time);
	}
	const isshow = false;
	const ishow = false;
	render(fd, {
		isDateTimePickerVisible1: isshow,
		isDateTimePickerVisible2: ishow,
		time2
	});
	a005(fd);
	a010(fd);
}
